#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
int main()
{
	int arr1[10] = { 0 };
	int arr2[10] = { 0 };
	int t = 0;

	for (int i = 0; i < 10; i++)
		scanf("%d", &arr1[i]);
	for (int i = 0; i < 10; i++)
		scanf("%d", &arr2[i]);
	for (int i = 0; i < 10; i++)
		printf("%d ", arr1[i]);
	printf("\n");
	for (int i = 0; i < 10; i++)
		printf("%d ", arr2[i]);
	printf("\n");
	for (int j = 0; j < 10; j++)
	{
		t = arr1[j];
		arr1[j] = arr2[j];
		arr2[j] = t;
	}
	for (int i = 0; i < 10; i++)
		printf("%d ", arr1[i]);
	printf("\n");
	for (int i = 0; i < 10; i++)
		printf("%d ", arr2[i]);

	return 0;
}